package com.orangelife.mobile.pay.biz;

import com.curry.android.http.VolleyHttpUtil;
import com.curry.android.util.StringUtil;
import com.orangelife.mobile.constants.Constant;
import com.orangelife.mobile.constants.PayURL;

import java.util.HashMap;

/**
 * 支付结果页的网络请求
 * <p>
 * Created by 吴格非 on 16/11/10.
 */

public class PayResultHttpBiz {

    public static void getHasLottery(String sourceType, VolleyHttpUtil.ResponseCallBack callback) {
        /*事件来源 0：登录成功, 1：话费充值, 2：物业缴费	必填*/
        HashMap<String, String> urlMap = new HashMap<>();
        urlMap.put("sourceType", sourceType);
        VolleyHttpUtil.getInstance().getWithCallback(PayURL.HAS_LOTTERY, urlMap, callback);
    }

    public static void addEventCollectionRecord(String sourceType, String money, VolleyHttpUtil.ResponseCallBack callback) {
        HashMap<String, Object> jsonMap = new HashMap<>();
        jsonMap.put("sourceType", sourceType);
        if (!StringUtil.isBlank(money) && money.startsWith(Constant.RMB_FLAG)) {
            money = money.substring(1);
        }
        jsonMap.put("money", money);
        VolleyHttpUtil.getInstance().putWithCallback(PayURL.ADD_EVENT, jsonMap, callback);
    }

}
